package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CofUserMapper;
import com.ruoyi.system.domain.CofUser;
import com.ruoyi.system.service.ICofUserService;

/**
 * 员工信息Service业务层处理
 * 
 * @author Lin
 * @date 2024-02-09
 */
@Service
public class CofUserServiceImpl implements ICofUserService 
{
    @Autowired
    private CofUserMapper cofUserMapper;

    /**
     * 查询员工信息
     * 
     * @param userId 员工信息主键
     * @return 员工信息
     */
    @Override
    public CofUser selectCofUserByUserId(Long userId)
    {
        return cofUserMapper.selectCofUserByUserId(userId);
    }

    /**
     * 查询员工信息列表
     * 
     * @param cofUser 员工信息
     * @return 员工信息
     */
    @Override
    public List<CofUser> selectCofUserList(CofUser cofUser)
    {
        return cofUserMapper.selectCofUserList(cofUser);
    }

    /**
     * 新增员工信息
     * 
     * @param cofUser 员工信息
     * @return 结果
     */
    @Override
    public int insertCofUser(CofUser cofUser)
    {
        cofUser.setCreateTime(DateUtils.getNowDate());
        return cofUserMapper.insertCofUser(cofUser);
    }

    /**
     * 修改员工信息
     * 
     * @param cofUser 员工信息
     * @return 结果
     */
    @Override
    public int updateCofUser(CofUser cofUser)
    {
        cofUser.setUpdateTime(DateUtils.getNowDate());
        return cofUserMapper.updateCofUser(cofUser);
    }

    /**
     * 批量删除员工信息
     * 
     * @param userIds 需要删除的员工信息主键
     * @return 结果
     */
    @Override
    public int deleteCofUserByUserIds(Long[] userIds)
    {
        return cofUserMapper.deleteCofUserByUserIds(userIds);
    }

    /**
     * 删除员工信息信息
     * 
     * @param userId 员工信息主键
     * @return 结果
     */
    @Override
    public int deleteCofUserByUserId(Long userId)
    {
        return cofUserMapper.deleteCofUserByUserId(userId);
    }
}
